home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource1
/
xlib20
/
example1.asm
next >
Wrap
Assembly Source File
|
1993-10-11
|
2KB
|
39 lines
.MODEL LARGE,PASCAL
.386P
INCLUDE XLIB.INC ;Include XLIB public symbols
INCLUDELIB XLIB.LIB ;Link with XLIB.LIB
.STACK 1024
.CODE
.STARTUP
CALL INITXLIB ;Initialize XLIB
OR EAX,EAX ;EAX = 0 if successful
JZ INITDONE
.EXIT 0 ;Initialization failed
INITDONE: PUSHD OFFSET DEMOPROC
CALL CALLPM ;Execute DEMOPROC in protected
.EXIT 0
;Protected-mode routines must be placed in following segment:
TSEG SEGMENT PARA PUBLIC USE32 'CODE'
ASSUME CS:TSEG, SS:TSEG, DS:TSEG, ES:TSEG, FS:DSEG, GS:DGROUP
;Protected-mode routine to print message to the screen using DOS function.
DEMOPROC PROC NEAR
MOV EBX,OFFSET PMMSG
MOV AH,02H
MSGLOOP: MOV DL,CS:[EBX] ;32-bit offset!!!!!
OR DL,DL
JZ EXIT
INT 21H ;Print character with DOS
INC EBX
JMP MSGLOOP
EXIT: RET ;Go back to real or V86 mode
PMMSG DB "In 32-bit protected mode!!! "
DB "Returning to real mode.",10,13,0
DEMOPROC ENDP
TSEG ENDS
END